import React, { useState } from 'react';
import './index.css';
import UploadFolder from '../../components/UploadFolder';
import MainLayout from '../../components/MainLayout';
import withAuth from '../../components/WithAuth';
import ProjectList from '../../components/ProjectList';

const UploadSoftware = () => {
    const [refreshKey, setRefreshKey] = useState(0);

    const handleUploadSuccess = () => {
        setRefreshKey(prev => prev + 1);
    };

    return (
        <MainLayout defaultSelectedKey="1">
            <UploadFolder onUploadSuccess={handleUploadSuccess} />
            <ProjectList key={refreshKey} /> {/* 添加 key 强制刷新 */}
        </MainLayout>
    );
};

export default withAuth(UploadSoftware);